UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xwr6v40/YTjugARKVlax1ujXJG38EKyWuVehSzaVofc='
WHERE
key_id = '5dd9133db1b330b127f8b579ed933ce7519f9954ae0005bdb562956ab7756a70'
AND (
token = 'xwr6v40/YTjugARKVlax1ujXJG38EKyWuVehSzaVofc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)