UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WH/FMAlHh6SJjlQ+1TJrgMlXICQSgPcXt8ZnTWkVC2A=' 
WHERE 
  key_id = '31d5d25ff4cfaa1dc7b212219392015f98b063529f27569cb55e97b41fbc3977' 
  AND (
    token = 'WH/FMAlHh6SJjlQ+1TJrgMlXICQSgPcXt8ZnTWkVC2A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025