UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fg9MuSjlKeYKwrS4e60LUROGQoKPuyRKs/zbwEbWzE8='
WHERE
key_id = '4a390caf42e9f4c7406913170392ff74cdf3a88c87f05e855dd3302f08400150'
AND (
token = 'Fg9MuSjlKeYKwrS4e60LUROGQoKPuyRKs/zbwEbWzE8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)