UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '95glsNUDiaMMSwZKARr5v1cJUBJx6+Vlt0h+E6vS1Yg='
WHERE
key_id = 'c7c0bf33738a9de9b143531941894300ce7e3506260a8061b9e8be8c6dbaa262'
AND (
token = '95glsNUDiaMMSwZKARr5v1cJUBJx6+Vlt0h+E6vS1Yg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)