UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rdF2k5u3PDZ8M40A3tWcIPVi/qm38bctwAP1TI8yWJU=' 
WHERE 
  key_id = 'd6b42dd602e29fa7cb22074650d656d1d05a395e122ddb489bc227ce634d603f' 
  AND (
    token = 'rdF2k5u3PDZ8M40A3tWcIPVi/qm38bctwAP1TI8yWJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029