UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '022G3dLrGzYLL+HJQ0mDfefk2ggnKNuP0DGpND0fhl0='
WHERE
key_id = '68a79ab1243072e9985d28461f1524b32665f9ec2147928cf1d5d1ee66843787'
AND (
token = '022G3dLrGzYLL+HJQ0mDfefk2ggnKNuP0DGpND0fhl0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)