UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AnaSzUjJ/BcFY3wNtw1G8BZBOBaOtK4v1S5WgZk+GHg='
WHERE
key_id = 'ca06e9728201a1f4061b31ca84c2caee37a249516204594e4dfb2646c2e03a55'
AND (
token = 'AnaSzUjJ/BcFY3wNtw1G8BZBOBaOtK4v1S5WgZk+GHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)