UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FFNVV85NmAYAztkWBvlSy8dnCMuM0QM87Oj/q7h5J0c=' 
WHERE 
  key_id = 'e3513be7186e18e2077e34d0f5fba87d21296a143dba5cc8248e94a27909025b' 
  AND (
    token = 'FFNVV85NmAYAztkWBvlSy8dnCMuM0QM87Oj/q7h5J0c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027