UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1sVQmq4CE42yAw7J/8ArI6VVPNgABKBaWzPPtgH7/9E='
WHERE
key_id = '1cf753e8dfe623c448b3c475dd980414efade6fe6f8e580be933c534c0f0123b'
AND (
token = '1sVQmq4CE42yAw7J/8ArI6VVPNgABKBaWzPPtgH7/9E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)