UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cb1byTAweM5QbdjxkM8Eq3A0om2/ggxVGLAP7284F3g=' 
WHERE 
  key_id = '15e620ac1118d96cda4af6880f62028ededa6e8bf1428070325f582fd20ecb90' 
  AND (
    token = 'Cb1byTAweM5QbdjxkM8Eq3A0om2/ggxVGLAP7284F3g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036