UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xFPRrx/Hlt00QyikI3SwGGFiUvHE+mc+b0efb8xT+NQ=' 
WHERE 
  key_id = 'c1f1087d87b1f68418446d54f00671e17c989d9036ad70a3fc06428b18eda2d6' 
  AND (
    token = 'xFPRrx/Hlt00QyikI3SwGGFiUvHE+mc+b0efb8xT+NQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048