UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Rv6hkiq853NffPiU8aX4yChBjNcdE9+iVp5Oo2mFfo='
WHERE
key_id = 'fc3c680b4bb614f6dba0d8362aeff006b4a6cb853b597a64ab60ca0bfa599537'
AND (
token = '4Rv6hkiq853NffPiU8aX4yChBjNcdE9+iVp5Oo2mFfo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)