UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+z20jVg+b3PvKdq3mNqeZQwAM0jACtLVyrzFBgleRX8=' 
WHERE 
  key_id = '34555567de04f41e384d7310227383c2920ca9e77b0b95d0f4a722d1fb25e8ba' 
  AND (
    token = '+z20jVg+b3PvKdq3mNqeZQwAM0jACtLVyrzFBgleRX8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035