UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YeFcjxvr2bGPheZ4cmPbOkYCIoUSe9iKit+5RxtdhnM='
WHERE
key_id = 'f3aca4744b259eaa675bd964a39b3290b464d44781190ce1cc3acab6675b1779'
AND (
token = 'YeFcjxvr2bGPheZ4cmPbOkYCIoUSe9iKit+5RxtdhnM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)