UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0cIlaP+9OL87aiyu2vFWEU4vAFuy7TooeClMC4nYao0='
WHERE
key_id = '526ac5f736def235e6dd2ca9e70e7a65c1f62560547ef040cae74c55f88bb5eb'
AND (
token = '0cIlaP+9OL87aiyu2vFWEU4vAFuy7TooeClMC4nYao0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)