UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EESkf/3AIxpE4J9JOuadFUUrGMor6OHw6leqU2oaRuc=' 
WHERE 
  key_id = '624578e530f0c9532fa0562a68be26d6962eef5fd40999835efb76b921a71976' 
  AND (
    token = 'EESkf/3AIxpE4J9JOuadFUUrGMor6OHw6leqU2oaRuc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030