UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '68U0Y8HsAXAmq7DCRuDV7eRsBM/I6KM2rujKjkfI9ww='
WHERE
key_id = '22c9240396fb186f42d84aaccb9dd06e0218edc67a151f3b6ce11fa3e283b26f'
AND (
token = '68U0Y8HsAXAmq7DCRuDV7eRsBM/I6KM2rujKjkfI9ww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)