UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lbVttrEJmmuN8yWqotGECJm3sajQAJhwWt6lxdzdKjg='
WHERE
key_id = '9675335b62c4a7fef69a9a37fc39cd1d77c58c5bf3863155b1cbf11b51110a5c'
AND (
token = 'lbVttrEJmmuN8yWqotGECJm3sajQAJhwWt6lxdzdKjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)