UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2RSVV9GH6N15ejm4qmegmJPM7G32hN5oPORRcvrQM2o=' 
WHERE 
  key_id = 'd159b03997c9a87267e13fd0dfa6f9de8a326c74b460cb921ffc3fa34c88a399' 
  AND (
    token = '2RSVV9GH6N15ejm4qmegmJPM7G32hN5oPORRcvrQM2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025