UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fvJ7i+E8imwq8Ks7sLZMi9y0kIf2zQMH8bWB8cvYYvM='
WHERE
key_id = 'fc81f64477315a9d1d7cd5731b8f7ef008023107f586daf9f16143663b0a4c4a'
AND (
token = 'fvJ7i+E8imwq8Ks7sLZMi9y0kIf2zQMH8bWB8cvYYvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)