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