UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9cQNcTFMMk7sYicEaqwMiitxhqb4mHT/V2qFg93VwqE=' 
WHERE 
  key_id = '6b63c3f0d677bccd6cd0a42d630fb92f82bafe090842125cafd22065e92b104c' 
  AND (
    token = '9cQNcTFMMk7sYicEaqwMiitxhqb4mHT/V2qFg93VwqE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025