UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YJxaHLatF5k+ZEFxr8hlBkD8rA+rjLjdhcfSG9se/5s='
WHERE
key_id = 'aec63a463b2feea66d2244cd463f3e382d261ce91f0b1c631b06f9db36bb22a0'
AND (
token = 'YJxaHLatF5k+ZEFxr8hlBkD8rA+rjLjdhcfSG9se/5s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)