UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dwd92AlPDnxdPK0ThovPaEb/yqIr9ZGgPwk+a3coAYs='
WHERE
key_id = '20941890227ea4565d83906fa463daef44b2fae696a763c298c10e0736a10a48'
AND (
token = 'dwd92AlPDnxdPK0ThovPaEb/yqIr9ZGgPwk+a3coAYs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)