UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YV8EPDfqCaHqVIHR2l0RbR1Hxwg4EcLM5VLMOgBCt28=' 
WHERE 
  key_id = 'bc6be5b2840772803b6d229b39d46a34ae5a2a5aa45b9d7290b3672aed75a382' 
  AND (
    token = 'YV8EPDfqCaHqVIHR2l0RbR1Hxwg4EcLM5VLMOgBCt28=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038