UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qGCqkH96tcjMXAtNPbSZbSdv6omzPeJMQbKS//vOTo4='
WHERE
key_id = '35be63f67f016d164bddeaae4d0c5fc4295e06c560a3268a96629c80341d233f'
AND (
token = 'qGCqkH96tcjMXAtNPbSZbSdv6omzPeJMQbKS//vOTo4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)