UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W8GfyTj3zskLhLlhL3HAl/rragTWlEZFnM/12tXWLQg='
WHERE
key_id = '08f9f62ac172a98b58468561bb5f1584972d0ab5636b3f6eb334c147a3df638a'
AND (
token = 'W8GfyTj3zskLhLlhL3HAl/rragTWlEZFnM/12tXWLQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)