UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vxuYzVdZyNqq7KczBuDhmKG0n63RBmrZp7LSFsO6rmM='
WHERE
key_id = '9f49e5a5954a8280b396d6179a80c377b890ec266f8ce4b85a6816dbe6b3c0eb'
AND (
token = 'vxuYzVdZyNqq7KczBuDhmKG0n63RBmrZp7LSFsO6rmM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)