UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2qu2WCn+GztOUmXjgd1dk2FH+kIJQnOJMW4yvOv7Td4='
WHERE
key_id = '30086df396a5e6a8a91287b3ca379c84f3b02060ef50149c5a244ddeb2da75ed'
AND (
token = '2qu2WCn+GztOUmXjgd1dk2FH+kIJQnOJMW4yvOv7Td4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)