UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HJe3NztSvPgWusb61I2Kt/P/RdBRvW5h8cG0KoFo9Rk='
WHERE
key_id = '48918fa9fbf53dd27409572d53dd632f12bfffc7be86a5765ddeb7c20c287f4c'
AND (
token = 'HJe3NztSvPgWusb61I2Kt/P/RdBRvW5h8cG0KoFo9Rk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)