UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8s9+XCbL/FOKN8/8/whNRloKYjhBp77uU54HCldvtm8='
WHERE
key_id = '1ff512b276419034ecd410938eb11b705e992c050fbe3bf692694a7a3cba650a'
AND (
token = '8s9+XCbL/FOKN8/8/whNRloKYjhBp77uU54HCldvtm8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)