UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b36XmGDeVNN1fINaKeJwHDGy7ivvUtAc5QXqZ5BSHEU=' 
WHERE 
  key_id = '5827bf0caca66cc6392ef4cf6b5e79770e93896c4cc6b5ef78a347e3983f4785' 
  AND (
    token = 'b36XmGDeVNN1fINaKeJwHDGy7ivvUtAc5QXqZ5BSHEU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.08131