UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ntzvrXt2AeI+eHd71tT5u5i2b70McEd9dZS8Meo4WQg='
WHERE
key_id = '51ec9a6b1453e896803831555d9a2b70b91bfb15a1b2c301bdd1f73fc49ae6af'
AND (
token = 'ntzvrXt2AeI+eHd71tT5u5i2b70McEd9dZS8Meo4WQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)