UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o/aQQKOH6HsjnM8o8cO0Qt0eno8+3jii69d2sVLUaO0='
WHERE
key_id = '3ba5ae84a44378d0bacba806718f86cb5e3e5a4e7de409ae4b8e742eedd7f6bb'
AND (
token = 'o/aQQKOH6HsjnM8o8cO0Qt0eno8+3jii69d2sVLUaO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)