UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'krKJ/xdnEpmYwPHBNI4auPcJBrZUVrJz+dbJc9OL7E0='
WHERE
key_id = 'a11824bf9867610418f8193e08542267c52b725a8f78e3174c376f3436667cc8'
AND (
token = 'krKJ/xdnEpmYwPHBNI4auPcJBrZUVrJz+dbJc9OL7E0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)