UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jeVv6U3VcS+wfC5B+Yu0BRGdrFsg7F8Gnzz3Gg/G1BQ=' 
WHERE 
  key_id = 'b54368566fa257fe316c33cbc8da99d4d429c2d20e3f21d3f6137b667ee15620' 
  AND (
    token = 'jeVv6U3VcS+wfC5B+Yu0BRGdrFsg7F8Gnzz3Gg/G1BQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035