UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jbp6SGvd9REOwpY4xSrB5AuuTa1HfwEVEqB8JLsI7Wo=' 
WHERE 
  key_id = '88045670e689215f800599be839b90d7a81863b923389d8c9f771189b23a6e77' 
  AND (
    token = 'jbp6SGvd9REOwpY4xSrB5AuuTa1HfwEVEqB8JLsI7Wo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025