UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ltHyWxteoFQEHBFBJ6SFOTYDgsZERQhIv29pNl/rGEE=' 
WHERE 
  key_id = 'f7216f9b341aa17718b4050f9fdba1fcb1e31a7909f74236975819d8a1b51232' 
  AND (
    token = 'ltHyWxteoFQEHBFBJ6SFOTYDgsZERQhIv29pNl/rGEE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020