UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1XpT1blNhvIHeIilzhtLyw4SMLrq/XxEiirn9LzmKXM='
WHERE
key_id = '4a901f80ab2ba944d810715d454366bfead3111d3518a7346fa71aa0122abf1b'
AND (
token = '1XpT1blNhvIHeIilzhtLyw4SMLrq/XxEiirn9LzmKXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)