UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wgz3ZRl2wYxFEcd4SMjAdDLXAy1dYbrEioRKrOm+HcM='
WHERE
key_id = 'c213dc00428bc16b4ccbb93a41ecce4eb717e169fb8555067b1147f7bf9bfaef'
AND (
token = 'wgz3ZRl2wYxFEcd4SMjAdDLXAy1dYbrEioRKrOm+HcM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)