UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1EzT/tYH9bISP6xiPtfBD7LNlvS3VoHLWyIFPT+J4dc=' 
WHERE 
  key_id = '4f6400d67709e2655caba041c645bdbdde11c4914e3f3d3e6b6e74ace36bbdfc' 
  AND (
    token = '1EzT/tYH9bISP6xiPtfBD7LNlvS3VoHLWyIFPT+J4dc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025