UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KAuSIzV0cI1fFgVcjY6EGZRwb9Fb0jHD9XUCtJr8fPY='
WHERE
key_id = '192ae3bc86439890b9b1957e49583f0d0a9addfddf995f636f2b6cce951b57d5'
AND (
token = 'KAuSIzV0cI1fFgVcjY6EGZRwb9Fb0jHD9XUCtJr8fPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)