UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lxQ7W0TqPPbUAnyFyqVFTTVK7KzgnppnMIUEg5DzSv8='
WHERE
key_id = 'fced22694d323a33df570dc00fa794ea5037bdfa14ec3627cb6479bda39b22f6'
AND (
token = 'lxQ7W0TqPPbUAnyFyqVFTTVK7KzgnppnMIUEg5DzSv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)